
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page language="java"%>

<style>
/*Chinh lai cho cai image calendar*/
.ui-datepicker-trigger {
	display: block;
}
</style>

<section>
	<div class="main">
		<div class="account-login">
			<div class="content">
				<c:set var="account" value="${account}" />
				<h2>Thông Tin Cá Nhân</h2>

				<form action="editinformation.do" method="post"
					accept-charset="utf-8">
					<ul class="form-list">

						<!--Cho nay hien thong bao loi khi tai khoan hoac mat khau khong hop le-->
						<c:if test="${error != null}">
							<br />
							<h4>Error: ${error}</h4>
						</c:if>
						<br />

						<li><label class="required" for="username">Tên đăng
								nhập<em>:</em>
						</label>
							<div class="input-box">
								<input name="username" type="text" title="Tên Đăng Nhập"
									readOnly=true
									class="input-text required-entry sumup_desgin_textbox"
									<c:choose>
										<c:when test="${account.username != null}">
											value="${account.username}"
										</c:when>
										 <c:otherwise>
										 	value=""
										 </c:otherwise>
									</c:choose> />
							</div>
							<div class="clear"></div></li>

						<li><label class="required" for="fullname">Họ và tên<em></em></label>
							<div class="input-box">
								<input name="fullname" type="text"
									class="input-text required-entry sumup_desgin_textbox"
									<c:choose>
										<c:when test="${account.accountInfo.fullname != null}">
											value="${account.accountInfo.fullname}"
										</c:when>
										 <c:otherwise>
										 	value=""
										 </c:otherwise>
									</c:choose> />
							</div>
							<div class="clear"></div></li>

						<li><label class="required" for="birthday">Ngày sinh<em></em></label>
							<div class="input-box">

								<!-- Cai nay de hien thi cho nguoi dung -->
								<input id="view_birthday" type="text" name="birthday"
									readOnly=true
									class="input-text required-entry sumup_desgin_textbox"
									<c:choose>
										<c:when test="${account.accountInfo.birthday != null}">
											value="${account.accountInfo.birthday}"
										</c:when>
										 <c:otherwise>
										 	value=""
										 </c:otherwise>
									</c:choose> />

								<!-- Cai nay` an? chi hien de lam datepicker -->
								<input id="birthday" type="hidden"
									class="input-text required-entry sumup_desgin_textbox" />
							</div> 
							<script>
								$(function() {
									$("#birthday")
											.datepicker(
													{
														showOn : "button",
														buttonImage : "<c:url value="/resources/images/calendar.gif" />",
														buttonImageOnly : true,
														showButtonPanel : true,
														changeMonth : true,
														changeYear : true,
													yearRange: "-103:-1"
													});
									// slide show datepicker
									$("#birthday").datepicker("option",
											"showAnim", "slide");
									// quy dinh cach hien thi ngay gio
									$("#birthday").datepicker("option",
											"dateFormat", "dd/mm/yy");
								});

								// neu input an? thay doi thi thay doi gia tri ben view_brithday
								$('#birthday').change(
										function() {
											// gan gia tri
											$("#view_birthday").val(
													$("#birthday").val());
										});
							</script>

							<div class="clear"></div></li>

						<li><label class="required" for="sex">Giới Tính<em></em></label>
							<div class="input-box">
								<input name="sex" type="text"
									class="input-text required-entry sumup_desgin_textbox"
									<c:choose>
										<c:when test="${account.accountInfo.sex != null}">
											value="${account.accountInfo.sex}"
										</c:when>
										 <c:otherwise>
										 	value=""
										 </c:otherwise>
									</c:choose> />
							</div>
							<div class="clear"></div></li>

						<li><label class="required" for="address">Địa Chỉ<em></em></label>
							<div class="input-box">
								<input name="address" type="text"
									class="input-text required-entry sumup_desgin_textbox"
									<c:choose>
										<c:when test="${account.accountInfo.address != null}">
											value="${account.accountInfo.address}"
										</c:when>
										 <c:otherwise>
										 	value=""
										 </c:otherwise>
									</c:choose> />
							</div>
							<div class="clear"></div></li>

						<li><label class="required" for="email">Email<em></em></label>
							<div class="input-box">
								<input name="email" type="text"
									class="input-text required-entry sumup_desgin_textbox"
									<c:choose>
										<c:when test="${account.accountInfo.email != null}">
											value="${account.accountInfo.email}"
										</c:when>
										 <c:otherwise>
										 	value=""
										 </c:otherwise>
									</c:choose> />
							</div>
							<div class="clear"></div></li>

						<li><label class="required" for="phone">Số điện thoại<em></em>
						</label>
							<div class="input-box">
								<input name="phone" type="text"
									class="input-text required-entry sumup_desgin_textbox"
									<c:choose>
										<c:when test="${account.accountInfo.phone != null}">
											value="${account.accountInfo.phone}"
										</c:when>
										 <c:otherwise>
										 	value=""
										 </c:otherwise>
									</c:choose> />
							</div>
							<div class="clear"></div></li>
						<br />
						<!-- Hien thong bao -->
						<c:if test="${done != null}">
							<br />
							<h4>${done}</h4>
						</c:if>

						<li><label class="required" for="btnSignup"><em></em></label>
							<div class="input-box">
								<input type="hidden" name="action" value="EditInformation" /> <input
									class="colors-btn" name="btnEditInformation" type="submit"
									value="Cập nhật" /> <input type="hidden" name="action"
									value="back" />
									<a class="colors-btn" type="button" href="account.do" >Quay lại</a>
							</div>
							<div class="clear"></div></li>
					</ul>
				</form>
			</div>
		</div>
	</div>
</section>
